from abc import ABC, abstractmethod

class PaymentMethod(ABC):
    @abstractmethod
    def pay(self, amount):
        pass

class BalancePayment(PaymentMethod):
    def pay(self, amount):
        return f"使用余额支付了 {amount} 块"

class CashPayment(PaymentMethod):
    def pay(self, amount):
        return f"使用现金支付了 {amount} 块"

class PointsPayment(PaymentMethod):
    def pay(self, amount):
        return f"使用了 {amount} 积分"

class CouponPayment(PaymentMethod):
    def pay(self, amount):
        return f"使用优惠券 {amount} 张"

class Page:
    def __init__(self, name):
        self.name = name

class Transaction:
    def __init__(self, user, page, payment_method, item, amount):
        self.user = user
        self.page = page
        self.payment_method = payment_method
        self.item = item
        self.amount = amount
